package cn.gok.controller;

import cn.gok.entity.User;
import cn.gok.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author: LKSV
 * @Description:
 * @Date:Created in 19:33 2021/7/21
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    @Resource
    private UserService userService;

    @GetMapping("/find")
    @ResponseBody
    public String queryUserInfo(Integer u_id, Map<String,Object> model){
        User user = userService.findUserById(u_id);
        model.put("user",user);
        return "userInfo";
    }
}
